home *** CD-ROM | disk | FTP | other *** search
/ Chip 2007 January, February, March & April / Chip-Cover-CD-2007-02.iso / Pakiet bezpieczenstwa / mini Pentoo LiveCD 2006.1 / mpentoo-2006.1.iso / livecd.squashfs / usr / lib / mozilla-firefox / include / necko / nsIContentSniffer.h < prev    next >
C/C++ Source or Header  |  2006-05-08  |  3KB  |  102 lines

  1. /*
  2.  * DO NOT EDIT.  THIS FILE IS GENERATED FROM nsIContentSniffer.idl
  3.  */
  4.  
  5. #ifndef __gen_nsIContentSniffer_h__
  6. #define __gen_nsIContentSniffer_h__
  7.  
  8.  
  9. #ifndef __gen_nsISupports_h__
  10. #include "nsISupports.h"
  11. #endif
  12.  
  13. /* For IDL files that don't want to include root IDL files. */
  14. #ifndef NS_NO_VTABLE
  15. #define NS_NO_VTABLE
  16. #endif
  17.  
  18. /* starting interface:    nsIContentSniffer */
  19. #define NS_ICONTENTSNIFFER_IID_STR "a5710331-74ec-45fb-aa85-ed3bc7c36924"
  20.  
  21. #define NS_ICONTENTSNIFFER_IID \
  22.   {0xa5710331, 0x74ec, 0x45fb, \
  23.     { 0xaa, 0x85, 0xed, 0x3b, 0xc7, 0xc3, 0x69, 0x24 }}
  24.  
  25. /**
  26.  * Content sniffer interface. Components implementing this interface can
  27.  * determine a MIME type from a chunk of bytes.
  28.  */
  29. class NS_NO_VTABLE nsIContentSniffer : public nsISupports {
  30.  public: 
  31.  
  32.   NS_DEFINE_STATIC_IID_ACCESSOR(NS_ICONTENTSNIFFER_IID)
  33.  
  34.   /**
  35.    * Given a chunk of data, determines a MIME type.
  36.    *
  37.    * @param aData Data to check
  38.    * @param aLength Length of the data
  39.    *
  40.    * @throw NS_ERROR_NOT_AVAILABLE if no MIME type could be determined.
  41.    */
  42.   /* ACString getMIMETypeFromContent ([array, size_is (aLength), const] in octet aData, in unsigned long aLength); */
  43.   NS_IMETHOD GetMIMETypeFromContent(const PRUint8 *aData, PRUint32 aLength, nsACString & _retval) = 0;
  44.  
  45. };
  46.  
  47. /* Use this macro when declaring classes that implement this interface. */
  48. #define NS_DECL_NSICONTENTSNIFFER \
  49.   NS_IMETHOD GetMIMETypeFromContent(const PRUint8 *aData, PRUint32 aLength, nsACString & _retval); 
  50.  
  51. /* Use this macro to declare functions that forward the behavior of this interface to another object. */
  52. #define NS_FORWARD_NSICONTENTSNIFFER(_to) \
  53.   NS_IMETHOD GetMIMETypeFromContent(const PRUint8 *aData, PRUint32 aLength, nsACString & _retval) { return _to GetMIMETypeFromContent(aData, aLength, _retval); } 
  54.  
  55. /* Use this macro to declare functions that forward the behavior of this interface to another object in a safe way. */
  56. #define NS_FORWARD_SAFE_NSICONTENTSNIFFER(_to) \
  57.   NS_IMETHOD GetMIMETypeFromContent(const PRUint8 *aData, PRUint32 aLength, nsACString & _retval) { return !_to ? NS_ERROR_NULL_POINTER : _to->GetMIMETypeFromContent(aData, aLength, _retval); } 
  58.  
  59. #if 0
  60. /* Use the code below as a template for the implementation class for this interface. */
  61.  
  62. /* Header file */
  63. class nsContentSniffer : public nsIContentSniffer
  64. {
  65. public:
  66.   NS_DECL_ISUPPORTS
  67.   NS_DECL_NSICONTENTSNIFFER
  68.  
  69.   nsContentSniffer();
  70.  
  71. private:
  72.   ~nsContentSniffer();
  73.  
  74. protected:
  75.   /* additional members */
  76. };
  77.  
  78. /* Implementation file */
  79. NS_IMPL_ISUPPORTS1(nsContentSniffer, nsIContentSniffer)
  80.  
  81. nsContentSniffer::nsContentSniffer()
  82. {
  83.   /* member initializers and constructor code */
  84. }
  85.  
  86. nsContentSniffer::~nsContentSniffer()
  87. {
  88.   /* destructor code */
  89. }
  90.  
  91. /* ACString getMIMETypeFromContent ([array, size_is (aLength), const] in octet aData, in unsigned long aLength); */
  92. NS_IMETHODIMP nsContentSniffer::GetMIMETypeFromContent(const PRUint8 *aData, PRUint32 aLength, nsACString & _retval)
  93. {
  94.     return NS_ERROR_NOT_IMPLEMENTED;
  95. }
  96.  
  97. /* End of implementation class template. */
  98. #endif
  99.  
  100.  
  101. #endif /* __gen_nsIContentSniffer_h__ */
  102.